
"""
    操作日志
"""

from rest_framework import serializers
from audit.models import OperationModel


class OperationModelSerializer(serializers.ModelSerializer):

    """
    操作日志序列化
    """

    time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S", required=False, read_only=True)

    class Meta:
        model = OperationModel
        fields = ('id', 'username', 'name', 'mobile', 'action', 'resource_type', 'resource', 'ip', 'time')
